import BaseConfig from "./base";

//添加阅览室
export function addReadingRoom(data) {
  return BaseConfig({
    method: "post",
    url: "/add_reading_room",
    data,
  });
}

//更新阅览室状态
export function updateRoomState(data) {
  return BaseConfig({
    method: "post",
    url: "/update_room_state",
    data,
  });
}

//批量添加用户
export function batchAddUser(data) {
  return BaseConfig({
    method: "post",
    url: "/batch_add_user",
    data,
  });
}

//添加单个用户
export function addUser(data) {
  return BaseConfig({
    method: "post",
    url: "/add_user",
    data,
  });
}

//删除阅览室
export function delReadingRoom(data) {
  return BaseConfig({
    method: "post",
    url: "/del_reading_room",
    data,
  });
}

//修改阅览室
export function changeReadingRoom(data) {
  return BaseConfig({
    method: "post",
    url: "/change_reading_room",
    data,
  });
}

//获取单间阅览室
export function getOneReadingRoom(id) {
  return BaseConfig({
    method: "get",
    url: "/reading_room_one",
    params: {
      id,
    },
  });
}

//获取所有用户信息
export function getUsersInfo() {
  return BaseConfig({
    method: "get",
    url: "/users_info",
  });
}

//修改用户信息
export function updateUserInfo(data) {
  return BaseConfig({
    method: "post",
    url: "/update_user_info",
    data,
  });
}

//删除用户信息
export function deleteUser(data) {
  return BaseConfig({
    method: "post",
    url: "/del_user",
    data,
  });
}

//更新用户状态
export function updateUserState(data) {
  return BaseConfig({
    method: "post",
    url: "/update_user_state",
    data,
  });
}

//获取所有意见
export function getFeedback() {
  return BaseConfig({
    method: "get",
    url: "/feedback",
  });
}

//回复意见
export function replyFeedback(data) {
  return BaseConfig({
    method: "post",
    url: "/reply_feedback",
    data,
  });
}

//发布公告
export function postNotice(data) {
  return BaseConfig({
    method: "post",
    url: "/post_notice",
    data,
  });
}

//获取公告
export function getNotice() {
  return BaseConfig({
    method: "get",
    url: "/get_notice",
  });
}

//删除公告
export function deleteNotice(data) {
  return BaseConfig({
    method: "post",
    url: "/del_notice",
    data,
  });
}
